import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/testhhh',
    name: '5',
    component: () => import('../views/testhhhh/test')
  },{
    path: '/',
    name: 'login',
    component: () => import('../views/account/login')
  }, {
    path: '/registered',
    component: () => import('../views/account/registered')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home'),
    redirect: '/cgsqdMg/weihu',
    children: [

        //采购申请
      {
        path: '/cgsqdMg/add',
        name: '/cgsqdMg/add',
        component: () => import ('@/views/cgsqdMg/add/index.vue'),
      }, {
        path: '/cgsqdMg/weihu',
        name: '/cgsqdMg/weihu',
        component: () => import ('@/views/cgsqdMg/weihu/index.vue'),
      },

      //采购订单
      {
        path: '/cgddMg/add',
        name: '/cgddMg/add',
        component: () => import ('@/views/cgddMg/add/index.vue'),
      },  {
        path: '/cgddMg/weihu',
        name: '/cgddMg/weihu',
        component: () => import ('@/views/cgddMg/weihu/index.vue'),
      },  {
        path: '/cgddMg/cankan',
        name: '/cgddMg/cankan',
        component: () => import ('@/views/cgddMg/cankan/index.vue'),
      },




      //外购入库
      {
        path: '/wgrkMg/add',
        name: '/wgrkMg/add',
        component: () => import ('@/views/wgrkMg/add/index.vue'),
      },
  {
        path: '/wgrkMg/weihu',
        name: '/wgrkMg/weihu',
        component: () => import ('@/views/wgrkMg/weihu/index.vue'),
      },
    ]
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
